<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Class: InterceptorFactory</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Class: InterceptorFactory</h1>

    




<section>

<header>
    
        <h2>InterceptorFactory</h2>
        
    
</header>

<article>
    <div class="container-overview">
    
        

    

    <h4 class="name" id="InterceptorFactory"><span class="type-signature"></span>new InterceptorFactory<span class="signature">()</span><span class="type-signature"></span></h4>

    



<div class="description">
    <p>拦截器工厂</p>
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="interceptorFactory.js.html">interceptorFactory.js</a>, <a href="interceptorFactory.js.html#line2">line 2</a>
    </li></ul></dd>
    

    

    

    
</dl>
















    
    </div>

    

    

    

     

    

    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    <h4 class="name" id="add"><span class="type-signature"></span>add<span class="signature">(fulfill, reject)</span><span class="type-signature"> &rarr; {Number}</span></h4>

    



<div class="description">
    <p>添加拦截器</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>fulfill</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>接收config参数进行拦截器设置</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>reject</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>处理拦截器的错误</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="interceptorFactory.js.html">interceptorFactory.js</a>, <a href="interceptorFactory.js.html#line16">line 16</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    <p>返回添加后拦截器的ID</p>
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Number</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id="forEach"><span class="type-signature"></span>forEach<span class="signature">(fn)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <p>对所有拦截器进行遍历,主要是为了去除null</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>fn</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last"><p>遍历处理函数</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="interceptorFactory.js.html">interceptorFactory.js</a>, <a href="interceptorFactory.js.html#line33">line 33</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
            

    

    <h4 class="name" id="remove"><span class="type-signature"></span>remove<span class="signature">(id)</span><span class="type-signature"></span></h4>

    



<div class="description">
    <p>根据ID移除拦截器工厂</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>id</code></td>
            

            <td class="type">
            
                
<span class="param-type">Number</span>


            
            </td>

            

            

            <td class="description last"><p>拦截器的ID</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="interceptorFactory.js.html">interceptorFactory.js</a>, <a href="interceptorFactory.js.html#line24">line 24</a>
    </li></ul></dd>
    

    

    

    
</dl>
















        
    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-Core.html">Core</a></li><li><a href="module-JSONP.html">JSONP</a></li><li><a href="module-Utils.html">Utils</a></li><li><a href="module-XHR.html">XHR</a></li></ul><h3>Classes</h3><ul><li><a href="Header.html">Header</a></li><li><a href="InterceptorFactory.html">InterceptorFactory</a></li><li><a href="module-Core-Q.html">Q</a></li><li><a href="Request.html">Request</a></li><li><a href="Response.html">Response</a></li></ul><h3>Namespaces</h3><ul><li><a href="q.html">q</a></li></ul><h3>Global</h3><ul><li><a href="global.html#contentInterceptor">contentInterceptor</a></li><li><a href="global.html#defaultOptions">defaultOptions</a></li><li><a href="global.html#xrfsInterceptor">xrfsInterceptor</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Tue Apr 18 2017 23:31:24 GMT+0800 (CST)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>